package com.itheima2.work2;

public class Student {
    String id;
    String mane;
    int age;

    public Student() {
    }

    public Student(String id, String mane, int age) {
        this.id = id;
        this.mane = mane;
        this.age = age;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMane() {
        return mane;
    }

    public void setMane(String mane) {
        this.mane = mane;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Demo1{" +
                "id=" + id +
                ", mane='" + mane + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student demo1 = (Student) o;

        if (id != demo1.id) return false;
        if (age != demo1.age) return false;
        return mane != null ? mane.equals(demo1.mane) : demo1.mane == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (mane != null ? mane.hashCode() : 0);
        result = 31 * result + age;
        return result;
    }
}
